<%@ taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%--
  Created by IntelliJ IDEA.
  User: LMY
  Date: 2025/6/22
  Time: 00:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
      <title>c:choose标签的使用</title>
  </head>

  <body>
    <h1>c:choose标签的使用</h1>
    <c:set value="90" var="score" scope="request"></c:set>
<%--
  1.如果 ${requestScope.score}，明确从request域对象取属性
  2.如果 ${score}，就按照从小到大的域范围去获取 pageContext -> request -> session -> application
  3.c:choose 类似switch
--%>
    <c:choose>
      <c:when test="${requestScope.score > 80}">
        <h1>成绩优秀</h1>
      </c:when>
      <c:when test="${requestScope.score >= 60}">
        <h1>成绩一般</h1>
      </c:when>
      <c:otherwise>
        <h1>不及格</h1>
      </c:otherwise>
    </c:choose>
  </body>
</html>
